const Sequelize = require('sequelize');
module.exports = function(sequelize, DataTypes) {
  return sequelize.define('tbbuilderlicencemanage', {
    operateUserName: {
      type: DataTypes.STRING(50),
      allowNull: true,
      field: 'OperateUserName'
    },
    operateDate: {
      type: DataTypes.DATE,
      allowNull: true,
      field: 'OperateDate'
    },
    rowId: {
      autoIncrement: true,
      type: DataTypes.INTEGER,
      allowNull: false,
      primaryKey: true,
      field: 'Row_ID'
    },
    rowIdentity: {
      type: DataTypes.STRING(50),
      allowNull: true,
      field: 'RowIdentity'
    },
    prjCode: {
      type: DataTypes.STRING(100),
      allowNull: true,
      field: 'PrjCode'
    },
    prjlinkNum: {
      type: DataTypes.STRING(30),
      allowNull: true,
      field: 'PrjlinkNum'
    },
    prjNum: {
      type: DataTypes.STRING(20),
      allowNull: true,
      field: 'PrjNum'
    },
    buiPrjName: {
      type: DataTypes.STRING(300),
      allowNull: true,
      field: 'BuiPrjName'
    },
    buildPlanNum: {
      type: DataTypes.STRING(200),
      allowNull: true,
      field: 'BuildPlanNum'
    },
    projectPlanNum: {
      type: DataTypes.STRING(200),
      allowNull: true,
      field: 'ProjectPlanNum'
    },
    tenderNum: {
      type: DataTypes.STRING(50),
      allowNull: true,
      field: 'TenderNum'
    },
    censorNum: {
      type: DataTypes.STRING(500),
      allowNull: true,
      field: 'CensorNum'
    },
    builderLicenceNum: {
      type: DataTypes.STRING(50),
      allowNull: true,
      field: 'BuilderLicenceNum'
    },
    bargainDays: {
      type: DataTypes.INTEGER,
      allowNull: true,
      field: 'BargainDays'
    },
    contractMoney: {
      type: DataTypes.DOUBLE(15,4),
      allowNull: true,
      field: 'ContractMoney'
    },
    applyConstrNum: {
      type: DataTypes.STRING(30),
      allowNull: true,
      field: 'ApplyConstrNum'
    },
    fundingSources: {
      type: DataTypes.STRING(100),
      allowNull: true,
      field: 'FundingSources'
    },
    area: {
      type: DataTypes.DOUBLE(15,2),
      allowNull: true,
      field: 'Area'
    },
    span: {
      type: DataTypes.DOUBLE(10,4),
      allowNull: true,
      field: 'Span'
    },
    prjSize: {
      type: DataTypes.STRING(500),
      allowNull: true,
      field: 'PrjSize'
    },
    planBDate: {
      type: DataTypes.DATE,
      allowNull: true,
      field: 'PlanBDate'
    },
    planEDate: {
      type: DataTypes.DATE,
      allowNull: true,
      field: 'PlanEDate'
    },
    organDate: {
      type: DataTypes.DATE,
      allowNull: true
    },
    econCorpCode: {
      type: DataTypes.STRING(30),
      allowNull: true,
      field: 'EconCorpCode'
    },
    econCorpName: {
      type: DataTypes.STRING(200),
      allowNull: true,
      field: 'EconCorpName'
    },
    designCorpCode: {
      type: DataTypes.STRING(30),
      allowNull: true,
      field: 'DesignCorpCode'
    },
    designCorpName: {
      type: DataTypes.STRING(200),
      allowNull: true,
      field: 'DesignCorpName'
    },
    consCorpCode: {
      type: DataTypes.STRING(30),
      allowNull: true,
      field: 'ConsCorpCode'
    },
    consCorpName: {
      type: DataTypes.STRING(200),
      allowNull: true,
      field: 'ConsCorpName'
    },
    safetyCerId: {
      type: DataTypes.STRING(50),
      allowNull: true,
      field: 'SafetyCerID'
    },
    idCardTypeNum: {
      type: DataTypes.STRING(3),
      allowNull: true,
      field: 'IDCardTypeNum'
    },
    idCardTypeText: {
      type: DataTypes.STRING(50),
      allowNull: true,
      field: 'IDCardTypeText'
    },
    constructorIdCard: {
      type: DataTypes.STRING(30),
      allowNull: true,
      field: 'ConstructorIDCard'
    },
    constructor: {
      type: DataTypes.STRING(30),
      allowNull: true,
      field: 'Constructor'
    },
    superCorpCode: {
      type: DataTypes.STRING(30),
      allowNull: true,
      field: 'SuperCorpCode'
    },
    superCorpName: {
      type: DataTypes.STRING(200),
      allowNull: true,
      field: 'SuperCorpName'
    },
    sidCardTypeNum: {
      type: DataTypes.STRING(3),
      allowNull: true,
      field: 'SIDCardTypeNum'
    },
    sidCardTypeText: {
      type: DataTypes.STRING(50),
      allowNull: true,
      field: 'SIDCardTypeText'
    },
    supervisionIdCard: {
      type: DataTypes.STRING(30),
      allowNull: true,
      field: 'SupervisionIDCard'
    },
    supervision: {
      type: DataTypes.STRING(30),
      allowNull: true,
      field: 'Supervision'
    },
    createDate: {
      type: DataTypes.DATE,
      allowNull: true,
      field: 'CreateDate'
    },
    twoDimCode: {
      type: DataTypes.TEXT,
      allowNull: true,
      field: 'TwoDimCode'
    },
    checkDepartName: {
      type: DataTypes.STRING(100),
      allowNull: true,
      field: 'CheckDepartName'
    },
    checkPersonName: {
      type: DataTypes.STRING(50),
      allowNull: true,
      field: 'CheckPersonName'
    },
    dataSource: {
      type: DataTypes.STRING(50),
      allowNull: true,
      field: 'DataSource'
    },
    sourceOuName: {
      type: DataTypes.STRING(50),
      allowNull: true,
      field: 'SourceOUName'
    },
    dataLevel: {
      type: DataTypes.STRING(1),
      allowNull: true,
      field: 'DataLevel'
    },
    sourceSysName: {
      type: DataTypes.STRING(50),
      allowNull: true,
      field: 'SourceSysName'
    },
    status: {
      type: DataTypes.STRING(2),
      allowNull: true,
      field: 'Status'
    },
    timeStamp: {
      type: DataTypes.DATE,
      allowNull: true,
      field: 'TimeStamp'
    },
    prjLength: {
      type: DataTypes.DOUBLE(10,4),
      allowNull: true,
      field: 'PrjLength'
    },
    stagestatus: {
      type: DataTypes.STRING(50),
      allowNull: true
    },
    rowguid: {
      type: DataTypes.STRING(50),
      allowNull: false,
      primaryKey: true
    },
    xmguid: {
      type: DataTypes.STRING(50),
      allowNull: true
    },
    qzkrowguid: {
      type: DataTypes.STRING(50),
      allowNull: true
    },
    linknum: {
      type: DataTypes.STRING(100),
      allowNull: true
    }
  }, {
    sequelize,
    tableName: 'tbbuilderlicencemanage',
    timestamps: false,
    indexes: [
      {
        name: "PRIMARY",
        unique: true,
        using: "BTREE",
        fields: [
          { name: "Row_ID" },
          { name: "rowguid" },
        ]
      },
      {
        name: "idx_PrjNum",
        using: "BTREE",
        fields: [
          { name: "PrjNum" },
        ]
      },
    ]
  });
};
